﻿using Huirui.Cavan.Domain.Seedwork;
using System;
using System.Collections;

namespace Huirui.Cavan.Domain.MainBoundedContext.SalesModule
{
	#region SalesInitial

	/// <summary>
	/// SalesInitial object for NHibernate mapped table 'SalesInitial'.
	/// </summary>
    [Serializable]
	public class SalesInitial : Persistent<long>
	{
		#region Member Variables
		
		protected string _corporationCode;
		protected int _initialType;
		protected DateTime _initialDate;
		protected string _currencyCode;
		protected string _otherCompanyName;
		protected decimal _amount;
		protected string _remark;

		#endregion

		#region Constructors

		public SalesInitial() { }

		public SalesInitial( string corporationCode, int initialType, DateTime initialDate, string currencyCode, string otherCompanyName, decimal amount, string remark, DateTime createDate, DateTime modifyDate, int editUser, byte[] version )
		{
			this._corporationCode = corporationCode;
			this._initialType = initialType;
			this._initialDate = initialDate;
			this._currencyCode = currencyCode;
			this._otherCompanyName = otherCompanyName;
			this._amount = amount;
			this._remark = remark;
			this._createDate = createDate;
			this._modifyDate = modifyDate;
			this._editUser = editUser;
			this._version = version;
		}

		#endregion

		#region Public Properties


		public virtual string CorporationCode
		{
			get { return _corporationCode; }
			set
			{
				if ( value != null && value.Length > 20)
					throw new ArgumentOutOfRangeException("Invalid value for CorporationCode", value, value.ToString());
				_corporationCode = value;
			}
		}

		public virtual int InitialType
		{
			get { return _initialType; }
			set { _initialType = value; }
		}

		public virtual DateTime InitialDate
		{
			get { return _initialDate; }
			set { _initialDate = value; }
		}

		public virtual string CurrencyCode
		{
			get { return _currencyCode; }
			set
			{
				if ( value != null && value.Length > 20)
					throw new ArgumentOutOfRangeException("Invalid value for CurrencyCode", value, value.ToString());
				_currencyCode = value;
			}
		}

		public virtual string OtherCompanyName
		{
			get { return _otherCompanyName; }
			set
			{
				if ( value != null && value.Length > 100)
					throw new ArgumentOutOfRangeException("Invalid value for OtherCompanyName", value, value.ToString());
				_otherCompanyName = value;
			}
		}

		public virtual decimal Amount
		{
			get { return _amount; }
			set { _amount = value; }
		}

		public virtual string Remark
		{
			get { return _remark; }
			set
			{
				_remark = value;
			}
		}

		

		#endregion
	}
	#endregion
}